package route

import (
	"github.com/gin-gonic/gin"
)

type InitializeRouter struct {
	Router *gin.RouterGroup
}

func NewInitializeRouter(router *gin.RouterGroup) *InitializeRouter {
	return &InitializeRouter{
		Router: router,
	}
}

func (i *InitializeRouter) Run() {
	i.Router.Static("/uploads", "./storage/uploads")
	i.Router.Static("/static", "./storage/static")
	i.Router.StaticFile("/favicon.ico", "./storage/web/dist/favicon.ico")
	//首页
	//i.Router.GET("/admin", admin.Index)

	//NewFrontendRouter(i.Router.Group("api")).FrontendInit()

	//i.Router.Use(middleware.DefaultLogger(), middleware.LimitIpMiddleware())
	NewWebRouter(i.Router.Group("")).WebInit()
	NewAdminRouter(i.Router.Group("/diaomao")).AdminInit()
}
